﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:env="xaml://kokomo/environment"
			 xmlns:pe="clr-namespace:Kokomo.PeInspector"
					xmlns:kui="xaml://kokomo/ui"
			 xmlns:r="clr-namespace:Kokomo.PeInspector.Reflection"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style TargetType="{x:Type pe:SearchView}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type pe:SearchView}">
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="*"/>
						</Grid.RowDefinitions>

						<TextBox
							Text="{Binding SearchTerm, RelativeSource={x:Static RelativeSource.TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
							kui:WatermarkService.WatermarkContent="Search"
							/>

						<Grid
							Grid.Row="1"
							>
							<ContentPresenter
								Name="ResultView"
								/>

							<Border
								Name="ProgressView"
								>
								<ContentPresenter Content="{TemplateBinding SearchProgress}"/>
							</Border>
						</Grid>
					</Grid>
					
					<ControlTemplate.Triggers>
						<Trigger Property="IsSearching" Value="True">
							<Setter TargetName="ResultView" Property="Visibility" Value="Hidden"/>
							<Setter TargetName="ProgressView" Property="Visibility" Value="Visible"/>
						</Trigger>
						<Trigger Property="IsSearching" Value="False">
							<Setter TargetName="ResultView" Property="Visibility" Value="Visible"/>
							<Setter TargetName="ProgressView" Property="Visibility" Value="Hidden"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>